
import org.jcsp.lang.*;

public class JcspFive {

	  public static void  main (String argv []) {

	    System.out.println ("");
	    System.out.println ("This version uses *symmetric* channels");
	    System.out.println ();

	    SpuriousLog.start ();

	    final int nPhil = 5;
	    System.out.println (nPhil + " iterations per timing ...\n");

	    One2OneChannelSymmetricInt a = Channel.one2oneSymmetricInt ();
	    One2OneChannelSymmetricInt b = Channel.one2oneSymmetricInt ();
	    One2OneChannelSymmetricInt c = Channel.one2oneSymmetricInt ();
	    One2OneChannelSymmetricInt d = Channel.one2oneSymmetricInt ();
	    
	    
	    JcspPhil phil1 = new JcspPhil(1, a.in(),b.in(),c.out(),d.out());
	    JcspPhil phil2 = new JcspPhil(2, c.in(),d.in(),a.out(),b.out());	

	     
	      new Parallel (
	       new CSProcess[] { phil1,phil2	        		
	       
	        }
	      ).run ();


	    System.out.println ("\n\n\nOnly gets here if all above parallel processes fail ...\n\n\n");

	  }

	}
	